/*
 * Project.java
 * 
 * Created on Nov 18, 2007, 12:20:51 AM
 * 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.usixml.admin.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import org.jboss.seam.annotations.Name;
import org.usixml.entity.util.AbstractEntity;

/**
 *
 * @author htmfilho
 */
@Entity
@Name("project")
public class Project extends AbstractEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    private String name;
    private String description;
    private List<Organization> organizations;
    private List<Platform> platforms;

    @Id
    @Override
    public String getId() {
        return super.getId();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @ManyToMany
    @JoinTable(name="organization_project", 
               joinColumns=@JoinColumn(name="project"),
               inverseJoinColumns=@JoinColumn(name="organization"))
    public List<Organization> getOrganizations() {
        return organizations;
    }

    public void setOrganizations(List<Organization> organizations) {
        this.organizations = organizations;
    }

    @OneToMany
    @JoinTable(name="platform_project",
               joinColumns=@JoinColumn(name="project"),
               inverseJoinColumns=@JoinColumn(name="platform"))
    public List<Platform> getPlatforms() {
        return platforms;
    }

    public void setPlatforms(List<Platform> platforms) {
        this.platforms = platforms;
    }
}